<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
    String adminBasePath = basePath + "admin/";
%>
<c:set var="basePath" value="<%=basePath%>"/>
<nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
    <div class="navbar-header">
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="${basePath}">jthinker</a>
    </div>
    <!-- /.navbar-header -->

    <ul class="nav navbar-top-links navbar-right">
        <li class="dropdown">
            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                <i class="fa fa-user fa-fw"></i> <i class="fa fa-caret-down"></i>
            </a>
            <ul class="dropdown-menu dropdown-user">
                <li>
                    <a href="<%=adminBasePath%>user/pass">
                        <i class="fa fa-user fa-fw"></i>
                        修改密码
                    </a>
                </li>
                <li>
                    <a href="#">
                        <i class="fa fa-gear fa-fw"></i>
                        设置
                    </a>
                </li>
                <li class="divider"></li>
                <li>
                    <a href="${basePath}doLogout">
                        <i class="fa fa-sign-out fa-fw"></i>
                        登出
                    </a>
                </li>
            </ul>
            <!-- /.dropdown-user -->
        </li>
        <!-- /.dropdown -->
    </ul>
    <!-- /.navbar-top-links -->

    <div class="navbar-default sidebar" role="navigation">
        <div class="sidebar-nav navbar-collapse">
            <ul class="nav" id="side-menu">
                <li class="sidebar-search">
                    <div class="input-group custom-search-form">
                        <input type="text" class="form-control" placeholder="Search...">
                                <span class="input-group-btn">
                                <button class="btn btn-default" type="button">
                                    <i class="fa fa-search"></i>
                                </button>
                            </span>
                    </div>
                    <!-- /input-group -->
                </li>
                <li>
                    <a href="<%=adminBasePath%>index">
                        <i class="fa fa-dashboard fa-fw"></i> Dashboard
                    </a>
                </li>
                <li>
                    <a href="#"><i class="fa fa-bar-chart-o fa-fw"></i> 文章管理<span class="fa arrow"></span></a>
                    <ul class="nav nav-second-level">
                        <li>
                            <a href="<%=adminBasePath%>post">所有文章</a>
                        </li>
                        <li>
                            <a href="<%=adminBasePath%>post/newPost">发布文章</a>
                        </li>
                        <li>
                            <a href="<%=adminBasePath%>category">分类目录</a>
                        </li>
                    </ul>
                    <!-- /.nav-second-level -->
                </li>
                <li>
                    <a href="tables.html">
                        <i class="fa fa-table fa-fw"></i>
                        菜单管理
                        <span class="fa arrow"></span>
                    </a>

                    <ul class="nav nav-second-level">
                        <li>
                            <a href="<%=basePath%>admin/menu">所有菜单</a>
                        </li>
                        <li>
                            <a href="<%=basePath%>admin/menu/newMenu">添加菜单</a>
                        </li>
                    </ul>
                </li>
                <li>
                    <a href="forms.html">
                        <i class="fa fa-edit fa-fw"></i>
                        用户<span class="fa arrow"></span>
                    </a>

                    <ul class="nav nav-second-level">
                        <li>
                            <a href="<%=adminBasePath%>user">所有用户</a>
                        </li>
                        <li>
                            <a href="<%=adminBasePath%>user/newUser">添加用户</a>
                        </li>
                        <li>
                            <a href="notifications.html">我的个人资料</a>
                        </li>
                    </ul>
                </li>
            </ul>
        </div>
        <!-- /.sidebar-collapse -->
    </div>
    <!-- /.navbar-static-side -->
</nav>
